﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using shop.Model;

namespace shop.Bll.BasicInfo
{
    public class EditingClearBll
    {

        public List<Editings> Query()
        {
            return DB.FSql.Select<Editings>().ToList();
        }

        public bool DeleteItem(Editings selectedEditing, out string msg)
        {
            try
            {
                DB.FSql.Delete<Editings>().Where(a => a.Id == selectedEditing.Id).ExecuteAffrows();

                msg = "删除成功";
                return true;
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return false;
            }

        }

        public void DeleteAllItem(out string msg)
        {
            try
            {
                DB.FSql.Delete<Editings>().Where("1=1").ExecuteAffrows();
                msg= "所有单据编辑状态已删除";
            }
            catch (Exception ex)
            {
                msg= ex.Message;
            }

        }
    }
}
